<?php
/*
 * This file is part of SoftSite.
 *
 * (c) 2012 Steve Tredinnick
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 *
 * @package softsite
 * @author  Steve Tredinnick <steve.tredinnick@gmail.com>
 */

namespace Lib\Forms\Elements;

use Lib\Forms\Elements\InputElement;

class CheckBoxElement extends InputElement
{

    public function __construct($name)
    {
        parent::__construct();
        $this->SetType("checkbox");
        $this->SetName($name);
    }

    private function ValidateHTML()
    {

    }

    /**
     * @desc Returns the generated HTML for the view.
     * @return string Generated HTML for the view.
     */
    public function RenderElement()
    {
        $this->GenerateHtml();
        return $this->formHtml;
    }
    
    /*
     * @desc Sets the checked status of the check box, defaults to not checked.
     */
    public function SetChecked($checked = false)
    {
        parent::SetChecked($checked);
    }

    public function SetValue($value)
    {
        parent::SetValue($value);
    }

    public function SetName($name)
    {
        parent::SetName($name);
    }

    public function SetLabel($label)
    {
        parent::SetLabel($label);
    }

    public function SetText($text)
    {
        parent::SetText($text);
    }

    /**
     * The required attribute is a boolean attribute.
     * When present, it specifies that an input field must be filled out before submitting the form.
     * Note: The required attribute works with the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file.
     *
     * @param bool $required
     */
    public function SetRequired($required)
    {
        parent::SetRequired($required);
    }

}
